/*
 * @Author: your name
 * @Date: 2021-04-23 23:32:50
 * @LastEditTime: 2021-04-24 07:25:02
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \offer20k\项目代码\fantasticit\src\components\Aside.tsx
 */
import React, { useEffect } from "react"
import styles from './aside.less'
import useStore from '@/context/useStore'
import { timeAgo } from '@/utils/index'
import { FileTextOutlined, AppstoreOutlined, TagsOutlined } from '@ant-design/icons'
import Articlecategory from './Articlecategory'
import Articletags from './Articletags'
import Airticlelist from './Airticlelist'
import {observer} from 'mobx-react-lite'

const Aside: React.FC = () => {
    let { article, category, tag } = useStore()

    useEffect(() => {
        // 获取右侧推荐
        article.getArticleRecommend();
        //  获取文章标签
        tag.getTagList();
        //  获取标签列表
        category.getCategoryList()
    }, [])
    
    return (
        <div className={styles.aside}>
            <div className={styles.sticky}>
                {/* 推荐文章 */}
                <Airticlelist />
                {/* 文章分类 */}
                <Articlecategory />
                {/* 文章标签 */}
                <Articletags />
            </div>
        </div>
    )
}
export default observer(Aside);